Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 1.
与えられた角度の Cos (コサイン、余弦) 値を計算します。角度の単位はラジアンです。この関数の戻り値は、-1 から 1 の範囲を取ります。
Using the angle Alpha, the Cos-Function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle.
たとえば角度αの Cos 値は、角度αを 1 つの頂角とする直角三角形を想定して、この頂点で交わる辺と斜辺の長さの比 (辺÷斜辺) として計算します。
Cos(Alpha) = Adjacent/Hypotenuse
Cos (α) = 頂角αに隣接する辺の長さ/斜辺の長さ
Cos (Number)
Cos (Number)
Double
倍精度
Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for.
Number: Cos 値を計算させる角度を示す数値表式 (単位はラジアン)。
To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi.
通常の角度をラジアン値に変換するには、角度×π/180 と計算します。ラジアン値を通常の角度に変換するには、ラジアン値×180/π と計算します。
degree=(radian*180)/pi
通常の角度の値 = (ラジアン値*180)/pi
radian=(degree*pi)/180
ラジアン値 = (通常の角度の値*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159...
ここで pi は、円周率πを示す 3.141592657 … という固定値です。
REM The following example allows for a right-angled triangle the input of
REM この例では、直角三角形の一辺の長さとその頂角 (通常の角度) を
REM secant and angle (in degrees) and calculates the length of the hypotenuse:
REM ユーザーに入力させて、斜辺の長さを計算しています。
Sub ExampleCosinus
Sub ExampleCosinus
REM rounded Pi = 3.14159
REM Pi = 3.14159 と近似
Dim d1 as Double, dAngle as Double
Dim d1 as Double, dAngle as Double
d1 = InputBox$ (""Enter the length of the adjacent side: ","Adjacent")
d1 = InputBox$ ("Enter the length of the adjacent side:","Adjacent")
dAngle = InputBox$ ("Enter the angle Alpha (in degrees): ","Alpha")
dAngle = InputBox$ ("Enter the angle Alpha (in degrees):","Alpha")
Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180))
Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180))
End Sub
End Sub